import { BaseController, CoolController } from "@cool-midway/core";
import { Inject, Post, Body } from "@midwayjs/core";
import { ProviderTeamJoinService } from "../../service/join";
import { JoinRequestDTO, AuditJoinRequestDTO } from "../../dto/join";

@CoolController({
    service: ProviderTeamJoinService,
})
export class ProviderJoinController extends BaseController {
    @Inject()
    providerTeamJoinService: ProviderTeamJoinService;

    @Post('/joinRequest', { summary: '发起加入团队请求' })
    async joinRequest(@Body() dto: JoinRequestDTO) {
        return this.ok(await this.providerTeamJoinService.joinRequest(dto));
    }

    @Post('/auditJoinRequest', { summary: '审核加入团队请求' })
    async auditJoinRequest(@Body() dto: AuditJoinRequestDTO) {
        return this.ok(await this.providerTeamJoinService.auditJoinRequest(dto));
    }
}
